<!DOCTYPE html>
<html>

	<head>
		<meta charset="utf-8">
		<title>Hello MUI</title>
		<meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1,user-scalable=no">
		<meta name="apple-mobile-web-app-capable" content="yes">
		<meta name="apple-mobile-web-app-status-bar-style" content="black">

		<link rel="stylesheet" href="../../css/mui.min.css">
		<link rel="stylesheet" href="../../css/app.css">
		<style>
			h4.mui-ellipsis {
				line-height: 20px;
			}
			.readed {
				font-weight: normal;
			}
			.due {
				font-weight: normal;
				color: #8f8f94;

			}
			.mui-input-row {
				margin: 15px 5px 0;
			}
			.mui-input-row input, .mui-input-row textarea{
				margin-bottom: 0;
			}
			
			.mui-input-row select{
				-webkit-appearance: menulist-button;
				border: 1px solid rgba(0,0,0,.2)!important;
				border-radius: 3px;
				margin-bottom: 0;
				padding-left: 15px;
			}
		</style>
	</head>

	<body>
		<header class="mui-bar mui-bar-nav">
			<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
			<h1 class="mui-title">登录</h1>
		</header>

		<div class="mui-content" style="background: white;">
			
			<div class="mui-input-row">
				<input type="text" class="mui-input-clear" value="" placeholder="手机号" id="cellphone">
			</div>
			<div class="mui-input-row">
				<input type="password" class="mui-input-clear" value="" placeholder="密码" id="password">
			</div>

			<div style="margin: 15px 5px 5px;">
				<button type="button" id="submit" class="mui-btn mui-btn-success mui-btn-block" style="padding-top: 10px;padding-bottom: 10px;">登录</button>
			</div>

		</div>

	</body>
	<script src="../../js/mui.min.js"></script>
	<script src="../../js/app.js"></script>
	<script src="../../js/_API.js"></script>
	<script>
		mui.init();
		
		document.getElementById("submit").addEventListener('click', function(){
			var param = {
				cellphone : document.getElementById('cellphone').value,
				password : document.getElementById('password').value,
				getuiClientId: plus.push.getClientInfo().clientid,
				os: plus.os.name,
				osVersion: plus.os.version,
				appType: "PeopleApp",
				remember: "Y"
			}
			plus.storage.setItem("cellphone",document.getElementById('cellphone').value);
	    		plus.storage.setItem("password",document.getElementById('password').value);
			
			_API.ajax('account/login', param)
			.success(function(json){
				_API.setPeople(json['userInfo']);
	    		plus.storage.setItem("...JSESSIONID", json['...JSESSIONID']);
	    		//通知Login事件
	    		mui.back();
			}).error(function(json){
				plus.nativeUI.toast(json.msgInfo);
			});
			
		});
	</script>
</html>